<template>
  <div class="register-container flex-center">
    <div class="register-wrap">
      <div class="flex align-start logo-wrap" style="user-select: none">
        <img src="../../assets/logo/logo.png" />
        <span>员工工作台</span>
      </div>
      <el-tabs v-model="activeName">
        <el-tab-pane label="账号注册" name="accountPane">
          <RegByAccount />
        </el-tab-pane>

        <el-tab-pane label="邮箱注册" name="mailPane">
          <RegByMail />
        </el-tab-pane>

        <el-tab-pane label="手机号注册" name="phonePane">
          <RegByPhone />
        </el-tab-pane>
      </el-tabs>

      <div class="others-wrap">
        <router-link to="/login" tag="a">已有账号？去登录</router-link>
      </div>
    </div>
  </div>
</template>

<script>
import RegByPhone from './regByPhone.vue'
import RegByAccount from './regByAccount.vue'
import RegByMail from './regByMail.vue'

export default {
  name: 'Register',
  components: {
    RegByPhone,
    RegByAccount,
    RegByMail
  },
  data() {
    return {
      activeName: 'accountPane'
    }
  }
}
</script>

<style lang="scss">
/* 修复input 背景不协调 和光标变色 */
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */

$cursor: gray;

@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
  .register-container .el-input input {
    color: $cursor;
  }
}

/* reset element-ui css */
.register-container {
  .el-input {
    display: inline-block;
    height: 47px;

    input {
      border: 0px;
      -webkit-appearance: none;
      border-radius: 0px;
      padding: 12px 5px 12px 15px;
      color: #000;
      height: 47px;
      caret-color: $cursor;

      &:-webkit-autofill {
        box-shadow: 0 0 0px 1000px #fff inset !important;
        -webkit-text-fill-color: #000 !important;
      }
    }
  }

  .el-form-item {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    color: #454545;
  }
}
</style>

<style lang="scss" scoped>
$bg: linear-gradient(to left, #1a2980, #26d0ce); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ * /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */

.register-container {
  min-height: 100%;
  width: 100%;
  background: $bg;
  overflow: hidden;

  .logo-wrap {
    position: absolute;
    top: -40px;
    height: auto;
    img {
      width: inherit;
      border-radius: 50%;
    }
    span {
      font-size: 30px;
      line-height: 40px;
      margin-left: 40px;
      color: #fff;
      font-weight: bold;
    }
  }

  .register-wrap {
    background: #fff;
    border-radius: 5px;
    position: relative;
    width: 500px;
    min-height: 350px;
    max-width: 100%;
    padding: 50px 35px 30px;
  }

  .others-wrap {
    font-size: 12px;
    text-align: center;
  }
}
</style>
